package com.github_Dididipapa.shortlink.project.config;

import org.redisson.api.RBloomFilter;
import org.redisson.api.RedissonClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @description: To be defined
 * @author: dididi_papa
 * @email: mitis1624087624@gmail.com
 * @date: 2025/09/09  15:04
 */
@Configuration
public class RBloomFilterConfiguration {

    @Bean("RBloom-link")
    public RBloomFilter<String> userRegisterCachePenetrationBloomFilter(RedissonClient redissonClient) {
        RBloomFilter<String> cachePenetrationBloomFilter = redissonClient.getBloomFilter("link");
        cachePenetrationBloomFilter.tryInit(1000000, 0.01);
        return cachePenetrationBloomFilter;
    }
}
